package com.pshcp.doctor.tool;

import com.framework.base.BaseDTO;
import com.framework.thread.ReqComTool;
import com.framework.tool.CommonTool;
import com.framework.util.SystemUtil;
import com.pshcp.doctor.ao.announcement.DoctorAnnouncementPageAO;
import com.pshcp.doctor.ao.announcement.SaveDoctorAnnouncementAO;
import com.pshcp.doctor.ao.article.DoctorArticlePageAO;
import com.pshcp.domain.dto.DoctorAnnouncementDTO;
import com.pshcp.domain.dto.DoctorArticleDTO;
import com.pshcp.domain.model.DoctorAnnouncement;

import java.util.List;

/**
 * @Description: TODO
 * @Author: xiaoche
 * @Date: 2022/11/3 19:22
 */
public class DoctorAnnouncementTool {

    public static DoctorAnnouncementDTO buildGetDoctorAnnouncementPage(DoctorAnnouncementPageAO doctorAnnouncementPageAO) {
        BaseDTO baseDTO = CommonTool.buildBaseDTO(doctorAnnouncementPageAO.getPageNum(), doctorAnnouncementPageAO.getPageSize());
        DoctorAnnouncementDTO doctorArticleDTO = new DoctorAnnouncementDTO();
        doctorArticleDTO.setPageNum(baseDTO.getPageNum());
        doctorArticleDTO.setPageSize(baseDTO.getPageSize());
        doctorArticleDTO.setDoctorId(ReqComTool.getUserId());
        return doctorArticleDTO;
    }
    public static DoctorAnnouncement buildSaveDoctorAnnouncement(SaveDoctorAnnouncementAO saveDoctorAnnouncementAO) {
        DoctorAnnouncement doctorAnnouncement = new DoctorAnnouncement();
        doctorAnnouncement.setDoctorId(ReqComTool.getUserId());
        doctorAnnouncement.setTitle(saveDoctorAnnouncementAO.getTitle());
        doctorAnnouncement.setContent(saveDoctorAnnouncementAO.getContent());
        return doctorAnnouncement;
    }

    public static DoctorAnnouncement buildSaveDoctorAnnouncement(DoctorAnnouncement doctorAnnouncement,SaveDoctorAnnouncementAO saveDoctorAnnouncementAO) {
        doctorAnnouncement.setTitle(saveDoctorAnnouncementAO.getTitle());
        doctorAnnouncement.setContent(saveDoctorAnnouncementAO.getContent());
        return doctorAnnouncement;
    }
}
